//
//  GKZYMajorIndustryListView.m
//  GKZYAid
//
//  Created by tony on 16/3/9.
//  Copyright © 2016年 GKZYAid. All rights reserved.
//

#import "GKZYMajorIndustryListView.h"
#import "MyDefine.h"

@interface GKZYMajorIndustryListView ()

@property(nonatomic,strong)UILabel *label0;
@property(nonatomic,strong)UILabel *label1;
@property(nonatomic,strong)UILabel *label2;

@end

@implementation GKZYMajorIndustryListView


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self addViews];
        CALayer *hTopBorder = [CALayer layer];
        hTopBorder.backgroundColor = [[UIColor darkGrayColor]CGColor];
        hTopBorder.frame = CGRectMake(-0.5, -0.5, VIEWWIDTH+1, 0.5);
        
        CALayer *vLeftBorder = [CALayer layer];
        vLeftBorder.frame = CGRectMake(-0.5, -0.5, 0.5, VIEWHEIGHT+1);
        vLeftBorder.backgroundColor = [[UIColor darkGrayColor]CGColor];
        
        CALayer *hBottomBorder = [CALayer layer];
        hBottomBorder.backgroundColor = [[UIColor darkGrayColor]CGColor];
        hBottomBorder.frame = CGRectMake(-0.5, VIEWHEIGHT, VIEWWIDTH+1, 0.5);
        
        CALayer *vRightBorder = [CALayer layer];
        vRightBorder.frame = CGRectMake(VIEWWIDTH, -0.5, 0.5, VIEWHEIGHT+1);
        vRightBorder.backgroundColor = [[UIColor darkGrayColor]CGColor];
        
        [self.layer addSublayer:hBottomBorder];
        [self.layer addSublayer:hTopBorder];
        [self.layer addSublayer:vRightBorder];
        [self.layer addSublayer:vLeftBorder];

        self.backgroundColor = [UIColor whiteColor];
        
    }
    return self;
}

-(void)addViews{
    
    self.label0 = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, VIEWWIDTH, VIEWHEIGHT/3)];
    self.label0.textAlignment = NSTextAlignmentCenter;
    self.label0.layer.borderWidth = 0.5f;
    self.label0.font = [UIFont systemFontOfSize:12];
    [self addSubview:self.label0];
    
    
    self.label1 = [[UILabel alloc]initWithFrame:CGRectMake(0, VIEWHEIGHT/3, VIEWWIDTH, VIEWHEIGHT/3)];
    self.label1.textAlignment = NSTextAlignmentCenter;
     self.label1.layer.borderWidth = 0.5f;
    self.label1.font = [UIFont systemFontOfSize:12];
    [self addSubview:self.label1];
    
    self.label2 = [[UILabel alloc]initWithFrame:CGRectMake(0, VIEWHEIGHT*2/3, VIEWWIDTH, VIEWHEIGHT/3)];
    self.label2.textAlignment = NSTextAlignmentCenter;
     self.label2.layer.borderWidth = 0.5f;
    self.label2.font = [UIFont systemFontOfSize:12];
    self.label2.textColor = [UIColor orangeColor];
    [self addSubview:self.label2];
    
  
  
}


-(void)setTheTitleWithOrder:(NSString *)order andName:(NSString *)name Percent:(NSString *)percent{

    self.label0.text = order;
    self.label1.text = name;
    NSString *string = @"%";
    self.label2.text = [percent stringByAppendingString:string];

}



@end
